<html>
<head><meta charset="utf-8"><title>versioned dlls · t-compiler/performance · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/index.html">t-compiler/performance</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/versioned.20dlls.html">versioned dlls</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="203558558"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/versioned%20dlls/near/203558558" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> drcarrybit <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/versioned.20dlls.html#203558558">(Jul 10 2020 at 21:15)</a>:</h4>
<p>It seems like some of the compile time issues are because everything including the kitchen sink is being shoved into the executable...</p>
<p>Would it be possible to have, even in just development environments, a versioned dll like ecosystem...</p>
<p>Prebuilt crates would exist and be callable. Different versions, and possibly debug and release versions of the crates could all be available. </p>
<p>Back in the day, dll's worked great at keeping existing code modules at arms length, but...  things got completely out of hand trying to deal with dll hell, or keeping different versions of a dll from causing all sorts of trouble as one binary required a newer one, and another an older.</p>
<p>Furthermore, would it be worthwhile to have an installer/updater create the same thing on end-user machines so a user machine would need just 1 copy of each version of a popular crate, instead of a copy inside most every rust binary...</p>



<a name="203558962"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/versioned%20dlls/near/203558962" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/versioned.20dlls.html#203558962">(Jul 10 2020 at 21:19)</a>:</h4>
<p>That is not really true, only <code>#[inline]</code> and generic functions are codegen'd in downstream crates</p>



<a name="203558970"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/versioned%20dlls/near/203558970" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/versioned.20dlls.html#203558970">(Jul 10 2020 at 21:19)</a>:</h4>
<p>also I'm not sure this is the best place to discuss that tbh</p>



<a name="203559002"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/versioned%20dlls/near/203559002" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/versioned.20dlls.html#203559002">(Jul 10 2020 at 21:19)</a>:</h4>
<p>also Rust technically has "versioned" libraries, but all of the relevant information is condensed into a hash instead</p>



<a name="203559083"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/versioned%20dlls/near/203559083" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/versioned.20dlls.html#203559083">(Jul 10 2020 at 21:20)</a>:</h4>
<p>like the Rust compiler is shipped as <code>librustc_driver-SOMEHASH.so</code></p>



<a name="203559096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/versioned%20dlls/near/203559096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/versioned.20dlls.html#203559096">(Jul 10 2020 at 21:20)</a>:</h4>
<p>the <code>rustc</code> executable is a very tiny wrapper that just calls into that</p>



<a name="203559117"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/versioned%20dlls/near/203559117" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/versioned.20dlls.html#203559117">(Jul 10 2020 at 21:20)</a>:</h4>
<p>(this allows e.g. <code>rustdoc</code> or clippy to not duplicate the entirety of that)</p>



<a name="203561183"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/versioned%20dlls/near/203561183" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> drcarrybit <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/versioned.20dlls.html#203561183">(Jul 10 2020 at 21:45)</a>:</h4>
<p>Thanks... I'm basing the idea on some thoughts after reading:</p>
<p><a href="https://raphlinus.github.io/rust/2019/08/21/rust-bloat.html">https://raphlinus.github.io/rust/2019/08/21/rust-bloat.html</a></p>
<p>but that's a pretty old article...</p>



<a name="203561226"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/versioned%20dlls/near/203561226" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/versioned.20dlls.html#203561226">(Jul 10 2020 at 21:46)</a>:</h4>
<p>it's not that old <em>shrug</em></p>



<a name="203561272"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/versioned%20dlls/near/203561272" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/versioned.20dlls.html#203561272">(Jul 10 2020 at 21:46)</a>:</h4>
<p>what would be nice is an user-wide compiler cache (with a mechanism that distros could maybe use for system-wide deps) but I don't know why that's not happening</p>



<a name="203561288"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/versioned%20dlls/near/203561288" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/versioned.20dlls.html#203561288">(Jul 10 2020 at 21:47)</a>:</h4>
<p>there's <code>sccache</code> but that feels like a bandaid more than a fix</p>



<a name="203561296"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/versioned%20dlls/near/203561296" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/versioned.20dlls.html#203561296">(Jul 10 2020 at 21:47)</a>:</h4>
<p>Yeah, I was going to suggest a shared build cache too, that seems way easier to implement (though not easy)</p>



<a name="203561304"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/versioned%20dlls/near/203561304" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/versioned.20dlls.html#203561304">(Jul 10 2020 at 21:47)</a>:</h4>
<p>anyway none of this is relevant to compile times IMO</p>



<a name="203561311"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/versioned%20dlls/near/203561311" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/versioned.20dlls.html#203561311">(Jul 10 2020 at 21:47)</a>:</h4>
<p>it only affects size on disk</p>



<a name="203561381"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/versioned%20dlls/near/203561381" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/versioned.20dlls.html#203561381">(Jul 10 2020 at 21:48)</a>:</h4>
<p>Well it affects the time from-scratch builds take, which are fairly common</p>



<a name="203561385"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/versioned%20dlls/near/203561385" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/versioned.20dlls.html#203561385">(Jul 10 2020 at 21:48)</a>:</h4>
<p>and while there might be something to discuss, I don't think it's on-topic (but I can't move the topic to a more general stream, a mod would have to do it)</p>



<a name="203561412"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/versioned%20dlls/near/203561412" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/versioned.20dlls.html#203561412">(Jul 10 2020 at 21:48)</a>:</h4>
<p>a shared build cache would, but it's not because of the linking model</p>



<a name="203561479"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/versioned%20dlls/near/203561479" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/versioned.20dlls.html#203561479">(Jul 10 2020 at 21:49)</a>:</h4>
<p>you can deduplicate build times with static linking, but the static vs dynamic linking difference is mainly in how big the build artifacts are</p>



<a name="203561548"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/versioned%20dlls/near/203561548" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/versioned.20dlls.html#203561548">(Jul 10 2020 at 21:50)</a>:</h4>
<p>true</p>



<a name="203561630"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/versioned%20dlls/near/203561630" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/versioned.20dlls.html#203561630">(Jul 10 2020 at 21:51)</a>:</h4>
<p>the way we put hashes in library names would be perfect for a shared build cache but eh I'm not the one working full-time on Cargo</p>



<a name="203561770"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/versioned%20dlls/near/203561770" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/versioned.20dlls.html#203561770">(Jul 10 2020 at 21:52)</a>:</h4>
<p>Is anyone?</p>



<a name="203564943"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/versioned%20dlls/near/203564943" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> drcarrybit <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/versioned.20dlls.html#203564943">(Jul 10 2020 at 22:33)</a>:</h4>
<p>Should this idea be suggested in a larger forum?  Which one?</p>
<p>Would it be better to private message some experts first?  If so, which one or ones?</p>



<a name="203565134"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/versioned%20dlls/near/203565134" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/versioned.20dlls.html#203565134">(Jul 10 2020 at 22:36)</a>:</h4>
<p>I'd suggest starting the discussion as focused on the problem, not a specific solution</p>



<a name="203565173"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/versioned%20dlls/near/203565173" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/versioned.20dlls.html#203565173">(Jul 10 2020 at 22:37)</a>:</h4>
<p>otherwise the discussion may hit dead-ends due to overfocusing on that one solution</p>



<a name="203565247"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/versioned%20dlls/near/203565247" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/versioned.20dlls.html#203565247">(Jul 10 2020 at 22:38)</a>:</h4>
<p>e.g. "version number" doesn't encapsulate anywhere nearly enough information to uniquely identify a possible build artifact for a Cargo package</p>



<a name="203565259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/versioned%20dlls/near/203565259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/versioned.20dlls.html#203565259">(Jul 10 2020 at 22:38)</a>:</h4>
<p>nor is dynamic linking particularly relevant to build times</p>



<a name="203565268"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/versioned%20dlls/near/203565268" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/versioned.20dlls.html#203565268">(Jul 10 2020 at 22:39)</a>:</h4>
<p>so you'll likely get people commenting on those aspects</p>



<a name="203565276"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/versioned%20dlls/near/203565276" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/versioned.20dlls.html#203565276">(Jul 10 2020 at 22:39)</a>:</h4>
<p>but anyway, just moving to <a class="stream" data-stream-id="122651" href="/#narrow/stream/122651-general">#general</a> or w/e should be fine</p>



<a name="203565621"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/versioned%20dlls/near/203565621" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> drcarrybit <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/versioned.20dlls.html#203565621">(Jul 10 2020 at 22:44)</a>:</h4>
<p>Where can I find out more about the time spent in each of the following main aspects of compiling/linking:</p>
<div class="codehilite"><pre><span></span><code>Parsing input

Name resolution, macro expansion, and configuration

Lowering to HIR

Type-checking and subsequent analyses

Lowering to MIR and post-processing

Translation to LLVM and LLVM optimizations

Linking
</code></pre></div>



<a name="203646711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/versioned%20dlls/near/203646711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/versioned.20dlls.html#203646711">(Jul 12 2020 at 14:49)</a>:</h4>
<p>I don't think there is someone working full time on cargo. And the big blocker to moving where target is for some libraries is, that it breaks all kinds of  users that expect the current locations.  Like we have not managed to land <a href="https://github.com/rust-lang/cargo/pull/6668">https://github.com/rust-lang/cargo/pull/6668</a></p>



<a name="203654377"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/versioned%20dlls/near/203654377" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/versioned.20dlls.html#203654377">(Jul 12 2020 at 18:11)</a>:</h4>
<p><em>oof</em></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>